﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Automation.Peers;
using System.Windows.Automation.Provider;

namespace WGM_Silverlight.Views
{
    public partial class LoginView : UserControl
    {
        public LoginView()
        {
            InitializeComponent();
        }
        public event MouseButtonEventHandler LoginClick
        {
            add
            {
                _loginBtn.MouseLeftButtonDown += value;
            }
            remove
            {
                _loginBtn.MouseLeftButtonDown -= value;
            }
        }
        public event MouseButtonEventHandler CreateAccountClick
        {
            add
            {
                _createAccountBtn.MouseLeftButtonDown += value;
            }
            remove
            {
                _createAccountBtn.MouseLeftButtonDown -= value;
            }
        }
        public event KeyEventHandler UsernameKeyUp
        {
            add
            {
                _usernameTb.KeyUp += value;
            }
            remove
            {
                _usernameTb.KeyUp -= value;
            }
        }
        public event KeyEventHandler PasswordKeyUp
        {
            add
            {
                _passwordTB.KeyUp += value;
            }
            remove
            {
                _passwordTB.KeyUp -= value;
            }
        }
        public string Password
        {
            get { return _passwordTB.Password; }
            set { _passwordTB.Password = value; }
        }
        public string Username
        {
            get { return _usernameTb.Text; }
            set { _usernameTb.Text = value; }
        }
        public string LoginMessage
        {
            get { return _loginMessageTb.Text; }
            set { _loginMessageTb.Text = value; }
        }
        public bool RememberLogin
        {
            get { return _rememberLoginChk.IsChecked.Value; }
            set { _rememberLoginChk.IsChecked = value; }
        }


        internal void ClearAnimations()
        {
            _loginBtn.ClearAnimation();
        }
    }
}
